/*
 * @Author: 徐建辰
 * @Date: 2022-02-15 09:19:32
 * @LastEditTime: 2022-02-15 10:17:47
 * @LastEditors: 徐建辰
 * @Description: 地址模块请求
 */
import request from './request'

// 获取地址列表
export const getAddressList = () => request({
  url: '/address',
  params: {pageNumber: 1, pageSize: 1000}
})

// 添加地址
export const addAddress = data => request({
  url: '/address',
  method: 'post',
  data
})

// 获取默认地址
export const getDefaultAddress = () => request({url: '/address/default'})

// 编辑地址
export const editAddress = params => request.put('/address', params)

// 删除地址
export const deleteAddress = id => request.delete(`/address/${id}`)

// 获取地址详情
export const getAddressDetail = id => request({url: `/address/${id}`})